Understanding The Consensus Mechanism In Blockchain